#include<stdio.h>
#include<string.h>
void sort(char *string[],int n);
int main()
{
	char *string[]={"apple","tangerine","grapefruit","banana","orange","pinrapple","grape","pitaya"};
	printf("original:\n");
	for(int i=0;i<8;i++)
	    printf("%s\n",string[i]);
	sort(string,8);
	return 0;
}

void sort(char *string[],int n)
{
	int i,j;
	char *t;
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(strcmp(string[i],string[j])>0)
		    {
		    	t=string[i];
		    	string[i]=string[j];
		    	string[j]=t;
			}
		} 
	}
	printf("clear:\n");
	for(i=0;i<8;i++)
	    printf("%s\n",string[i]);
}
